"""
@Time: 2021/1/14 下午 7:15
@Author: jinzhuan
@File: ace2005_cn.py
@Desc: 
"""
import torch
from cognlp.io.loader.ee.ace2005 import ACE2005Loader
from cognlp import Vocabulary
from cognlp.io.processor.ee.ace2005_cn import ACE2005CNProcessor
from cognlp.core.datableset import DataTableSet

torch.cuda.set_device(1)
loader = ACE2005Loader()
train_data, dev_data, test_data = loader.load_all('../../../../cognlp/data/ee/ace2005-cn/data')

trigger_vocabulary = Vocabulary()
trigger_vocabulary.add_word_lst(loader.get_trigger_labels())
trigger_vocabulary.build_vocab()
trigger_vocabulary.save('../../../../cognlp/data/ee/ace2005-cn/data/trigger_vocabulary.txt')

argument_vocabulary = Vocabulary()
argument_vocabulary.add_word_lst(loader.get_argument_labels())
argument_vocabulary.build_vocab()
argument_vocabulary.save('../../../../cognlp/data/ee/ace2005-cn/data/argument_vocabulary.txt')

processor = ACE2005CNProcessor(trigger_path='../../../../cognlp/data/ee/ace2005-cn/data/trigger_vocabulary.txt',
                               argument_path='../../../../cognlp/data/ee/ace2005-cn/data/argument_vocabulary.txt')
train_datable = processor.process(train_data)
print(1)
